package org.example;

import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:何人亮
 * Date:2024-11-09
 * 22:36
 */
class Test{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int[] arr=new int[4];
        for(int i=0;i<4;i++){
            arr[i]=sc.nextInt();
        }
        Arrays.sort(arr);
        int n1=Math.abs(arr[1]-arr[0]);
        int n2=Math.abs(arr[3]-arr[2]);
        int n=Math.abs(n2-n1);
        System.out.println(n);
    }
}